/*
 * Copyright (c) 2025, 大连理工大学 (Dalian University of Technology)
 *
 * Licensed under the Mulan PSL v2.
 * You can use this file according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of the License at
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SEE THE MULAN PSL v2
 * FOR MORE DETAILS.
 */

/*
 * @Author: qiulin 1746365080@qq.com
 * @Date: 2024-11-19 13:49:34
 * @LastEditors: qiulin 1746365080@qq.com
 * @LastEditTime: 2024-11-19 13:50:17
 * @FilePath: /SGFEM/DBManager/Service/Parameter/ParameterService.h
 */

#pragma once
#include "DBManager/IRepository/Input/Parameter/IParameterRepository.h"
#include "DBManager/IService/Input/Parameter/IParameterService.h"

/// @brief Parameter Data manipulation interface

SG_DBMANAGER_NAMESPACE_OPEN
class DBManager_DECLSPEC ParameterService : public IParameterService
{
  public:
    ParameterService (IParameterRepository& repos);
    ~ParameterService ();

    /// @brief 初始化仓库，只能初始化一次
    /// @param entity
    void Initial (SG::Utility::SGParameter entity) override;

    SG::Utility::SGParameter GetSolverParameter () const override;

    void AddExecutiveSystem (SG::Utility::SGParameter entity) override;

    SG::Utility::SGParameter GetExecutiveSystemParameter () override;

    ///@{ @brief get/set custom parameter value

    /// @brief 返回所有的自定义参数
    SG::Utility::SGParameter GetCustomParameter () const override;

    void SetCustomParameter (std::string key, bool value) override;
    void SetCustomParameter (std::string key, int32_t value) override;
    void SetCustomParameter (std::string key, double value) override;
    void SetCustomParameter (std::string key, std::string value) override;
    ///}@

  private:
    IParameterRepository& m_repository;
};

SG_DBMANAGER_NAMESPACE_CLOSE
